/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.camara.jersey.Dao;

import com.camara.jersey.Model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


public class UserDao {
    
    private static List <User> listUsers = new ArrayList <User> ();
    private static HashMap <Integer,User> data = new HashMap <Integer,User> ();
    
    
    
    
    private static void initialise () {
        User user1 = new User (100,"atcamara","passer");
        User user2 = new User (101,"sambe","admin");
        User user3 = new User (102,"kane","visitior");
        listUsers.add(user1);
        listUsers.add(user2);
        listUsers.add(user3);
        data.put(1, user1);
        data.put(2, user2);
        data.put(3, user3);
        
        
        
    }

    public List<User> getListUsers() {
        this.initialise();
        return listUsers;
    }

    public void setListUsers(List<User> listUsers) {
        this.listUsers = listUsers;
    }

    public static HashMap<Integer, User> getData() {
        initialise();
        return data;
    }

    public void setData(HashMap<Integer, User> data) {
        this.data = data;
    }
    
    
}
